﻿package dut.ir.lxb.weibo.main;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.apache.log4j.DailyRollingFileAppender;
import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;

import dut.ir.lxb.weibo.spider.UserWeiboDownloadThread;


public class UserWeiboDownloadTest
{
	
	public static Logger logger = Logger.getLogger(UserWeiboDownloadTest.class);
	
	static
	{
		PropertyConfigurator.configure("./config/log4j.properties");
		DailyRollingFileAppender appender = (DailyRollingFileAppender)Logger.getRootLogger().getAppender("DayRollingFile");
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		String dateValue = sdf.format(new Date());
		appender.setFile(String.format("./log/%s.log", dateValue));
		appender.activateOptions();
		
	}
	
	
	public static void main(String [] args)
	{
		UserWeiboDownloadThread downloadThread = new UserWeiboDownloadThread();
		
		Thread thread1 = new Thread(downloadThread, "weibothread1");
		thread1.start();
		
	}
	
	
	
}
